<?php
/**
 * 招聘信息管理页面
 *
 * @author Alen
 * @since 1.0.0 2013-10-5 sutroon
 */
class JoinUs_ListAction  extends AdmincpAction {
    
    //put your code here
    public function index(){
        // 设置页面导航
        $this->set_breadcrumb(array('招聘管理'=>'###','列表'=>'###'));
        // 设置页面标题
        $this->set_h1('招聘管理','在这里管理所有招聘');
        
        // 设置页面信息,如页面标题,meta信息等
        $this->set_page_info('招聘管理');
        
        $biz=new SoBizJob();        
        $pager_text='';
        $dataset=null;
        $biz->get_paging_data($pager_text, $dataset, request_numeric('page'), request_string('keyword'));
        
        $this->assign('pager',$pager_text);
        
        // 构建数据表格
        $this->uig->begin_table();
        $this->uig->add_thead('#','编号','职位名称','招聘人数', '薪资待遇', '日期','状态','管理');
        
        if($dataset){
            $bizc=new SoBizCommon();
            foreach($dataset as $row){
                $this->uig->add_trow($row['SerialNo'],$row['SerialNo'],$row['Name'],$row['Quantity'],$row['Wages'],$row['CreatedTime'],$bizc->switch_state(array('v'=>$row['State'],'group'=>array('0'=>'未读','1'=>'已读'))),$this->get_control_linkbuttons($row['ID'],$row['Title'],'Feedback',array('delete') ));
            }
        }
        $this->uig->end_table();
        $this->assign('table',$this->uig->get_text());        
        // 显示模板
        $this->display();
    }
    
    public function delete(){        
        $id=request_numeric('id');
        if($id){            
            $this->dm->delete_records('tinfojob','ID='.$id);
            redirect('删除成功','?m=JoinUs_List');        
        }
    }
}

?>
